package ko.util;

import java.util.ArrayList;

public class KPropertyInfoObj {
	public float valueStart; // Starting value of the tweening (null if not
								// started yet)
	public float valueComplete; // Final desired value
	public Object originalValueComplete; // Final desired value as declared
											// initially
	public float arrayIndex; // Index (if this is an array item)
	public Object extra; // Additional parameters, used by some special
							// properties
	public Boolean isSpecialProperty; // Whether or not this is a special
										// property instead of a direct one
	public Boolean hasModifier; // Whether or not it has a modifier function
	public IFunction modifierFunction; // Modifier function, if any
	public ArrayList<Object> modifierParameters; // Additional array of modifier
	
	public KPropertyInfoObj(float p_valueStart, float p_valueComplete) {
		KPropertyInfoObjHelper(p_valueStart, p_valueComplete, new Object(), 0.0f, new Object(),null, null,null);
	}

	public KPropertyInfoObj(float p_valueStart, float p_valueComplete,
			Object p_originalValueComplete, float p_arrayIndex, Object p_extra,
			Boolean p_isSpecialProperty, IFunction p_modifierFunction,
			ArrayList<Object> p_modifierParameters) {
		KPropertyInfoObjHelper(p_valueStart, p_valueComplete, p_originalValueComplete, 
				p_arrayIndex, p_extra, p_isSpecialProperty, p_modifierFunction,p_modifierParameters);
	}
	
	public void KPropertyInfoObjHelper(float p_valueStart, float p_valueComplete,
			Object p_originalValueComplete, float p_arrayIndex, Object p_extra,
			Boolean p_isSpecialProperty, IFunction p_modifierFunction,
			ArrayList<Object> p_modifierParameters) {
		valueStart = p_valueStart;
		valueComplete = p_valueComplete;
		originalValueComplete = p_originalValueComplete;
		arrayIndex = p_arrayIndex;
		extra = p_extra;
		isSpecialProperty = p_isSpecialProperty;
		hasModifier = (p_modifierFunction != null);
		modifierFunction = p_modifierFunction;
		modifierParameters = p_modifierParameters;
	}

	public KPropertyInfoObj clone() {
		return new KPropertyInfoObj(valueStart, valueComplete,
				originalValueComplete, arrayIndex, extra, isSpecialProperty,
				modifierFunction, modifierParameters);
	}

	public String toString() {
		String returnStr = "[PropertyInfoObj ";
		returnStr += "valueStart:" + String.valueOf(valueStart);
		returnStr += ", ";
		returnStr += "valueComplete:" + String.valueOf(valueComplete);
		returnStr += ", ";
		returnStr += "originalValueComplete:" + originalValueComplete.toString();
		returnStr += ", ";
		returnStr += "arrayIndex:" + String.valueOf(arrayIndex);
		returnStr += ", ";
		returnStr += "extra:" + extra.toString();
		returnStr += ", ";
		returnStr += "isSpecialProperty:" + isSpecialProperty.toString();
		returnStr += ", ";
		returnStr += "hasModifier:" + hasModifier.toString();
		returnStr += ", ";
		returnStr += "modifierFunction:" + modifierFunction.toString();
		returnStr += ", ";
		returnStr += "modifierParameters:" + modifierParameters.toString();
		returnStr += "]";
		return returnStr;
	}

}
